<template>
  <div id="cards">
    <div class="card-item">
      <div class="card-header">
        <div class="card-header-left">
         一级情绪走势
          <dv-decoration-3 style="width: 200px; height: 20px" />
        </div>
      </div>
      <dv-charts :option="option1" />
    </div>
    <div class="card-item">
      <div class="card-header">
        <div class="card-header-left">
          二级情绪走势
          <dv-decoration-3 style="width: 200px; height: 20px" />
        </div>
      </div>
      <dv-charts :option="option2" />
    </div>
  </div>
</template>

<script>
export default {
  name: "Cards",
  data() {
    return {
      option1: {
        legend: {
          data: ['设备完好率','设备完好'],
          textStyle: {
            fill: '#fff'
          }
        },
        xAxis: {
          data: [
            '10/01', '10/02', '10/03', '10/04', '10/05', '10/06',
            '10/07', '10/07', '10/08', '10/09', '10/10', '10/11',
            '10/12', '10/13', '10/14', '10/15'
          ],
          boundaryGap: false,
          axisLine: {
            style: {
              stroke: '#999'
            }
          },
          axisLabel: {
            style: {
              fill: '#999'
            }
          },
          axisTick: {
            show: false
          }
        },
        yAxis: {
          data: 'value',
          splitLine: {
            show: false
          },
          axisLine: {
            style: {
              stroke: '#999'
            }
          },
          axisLabel: {
            style: {
              fill: '#999'
            },
            formatter ({ value }) {
              return value.toFixed(2)
            }
          },
          axisTick: {
            show: false
          },
          min: 95,
          max: 100,
          interval: 0.5
        },
        series: [
          {
            data: [
              99.56, 99.66, 99.84, 99.22, 99.11, 99.45,
              99.44, 99.81, 99.84, 99.32, 99.14, 99.45,
              99.15, 99.45, 99.64, 99.89
            ],
            type: 'line',
            name: '设备完好率',
            smooth: true,
            lineArea: {
              show: true,
              gradient: ['rgba(55, 162, 218, 0.6)', 'rgba(55, 162, 218, 0)']
            },
            linePoint: {
              radius: 4,
              style: {
                fill: '#00db95'
              }
            }
          }
        ]
      },
      option2:{
        legend: {
          data: ["设备完好率","设备完好"],
          textStyle: {
            fill: "#fff",
          },
        },
        xAxis: {
          data: [
            "10/01",
            "10/02",
            "10/03",
          ],
          boundaryGap: false,
          axisLine: {
            style: {
              stroke: "#999",
            },
          },
          axisLabel: {
            style: {
              fill: "#999",
            },
          },
          axisTick: {
            show: false,
          },
        },
        yAxis: {
          data: "value",
          splitLine: {
            show: false,
          },
          axisLine: {
            style: {
              stroke: "#999",
            },
          },
          axisLabel: {
            style: {
              fill: "#999",
            },
          
          },
          axisTick: {
            show: false,
          },
        },
        series: [
          {
            data: [
              99.56,
              99.66,
              99.84,
            ],
            type: "line",
            name: "设备完好率",
            smooth: true,
            lineArea: {
              show: true,
              gradient: ["rgba(55, 162, 218, 0.6)", "rgba(55, 162, 218, 0)"],
            },
            linePoint: {
              radius: 4,
              style: {
                fill: "#00db95",
              },
            },
          },
           {
            data: [
              99.56,
              99.66,
              95,
            ],
            type: "line",
            name: "设备完好",
            smooth: true,
            lineArea: {
              show: true,
            },
            linePoint: {
              radius: 4,
              style: {
                fill: "#00db95",
              },
            },
          },
        ],
      },
    };
  },
};
</script>

<style lang="less">
#cards {
  display: flex;
  justify-content: space-between;
  height: 45%;

  .card-item {
    background-color: rgba(6, 30, 93, 0.5);
    border-top: 2px solid rgba(1, 153, 209, 0.5);
    width: 49%;
    display: flex;
    flex-direction: column;
  }

  .card-header {
    display: flex;
    height: 20%;
    align-items: center;
    justify-content: space-between;

    .card-header-left {
      font-size: 18px;
      font-weight: bold;
      padding-left: 20px;
    }

  }

}
</style>
